import {Link,useNavigate} from "react-router-dom";
import {useState} from "react";

const Login=()=>{
    const navigate = useNavigate()
    const [count, setCount] = useState(10)
    const [title,setTitle]=useState([
        {id:1,title:'张三'},
        {id:2,title:'李四'},
    ])
    return (
        <div>
            <div>登录页</div>
            <button onClick={()=>navigate('/?id='+count+'&title='+JSON.stringify(title))}>
                {/*<Link to="/">跳转到首页</Link>*/}
                跳转到首页
            </button>
            <button onClick={()=>navigate('/article/100')}>跳转到文章</button>
        </div>
    )
}
export default Login